<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<table class="display" id="example">
	<thead>
		<tr>
			<th>所属年份</th>
			<th>部门</th>
			<th>完成分值</th>
			<th>总分</th>
		</tr>
	</thead>
	<tbody>
		<s:if test="#request.credits==null || #request.credits.size<=0">
			<tr class="gradeA">
				<td colspan="4">暂无数据</td>
			</tr>
		</s:if>
		<s:else>
			<s:iterator var="credit" status="sta" value="#request.credits">
				<s:if test="#sta.even">
					<tr class="gradeA">
				</s:if>
				<s:else>
					<tr class="gradeC">
				</s:else>
				<td>${credit.year}</td>
				<td>${credit.organization.fullName}</td>
				<td><span name="td_credit" title="${credit.organization.id}"></span></td>
				<td><span id="GridView1_ctl04_Label1">${credit.totalScore}</span></td>
				</tr>
			</s:iterator>
		</s:else>
	</tbody>
</table>
<p>
	<%@ include file="/WEB-INF/pages/common/main_orgtab_pager_train.jsp"%>
</p>
<div class="clear"></div>

<script type="text/javascript">
<!--
	$(document).ready(function() {
		$("span[name='td_credit']").each(function(i) {
			loadDutyTargetCredit(this, $(this).attr("title"));
		});
	});

	function loadDutyTargetCredit(obj, organizationId) {
		$.ajax({
			type : "get",
			url : "/ajax/query_dutytarget_credit.xhtml?organizationId=" + organizationId+"&year=${year}",
			//data: "name=John&location=Boston",
			dataType : "json",
			success : function(data) {
				if (data != null) {
					$(obj).html(data);
				}
			}
		});
	}
//-->
</script>

